<%@page  import="com.yc.weixin.util.WeixinbasicKey"%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>一键报名</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/mui.min.css">
		<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
	</head>

	<body>
		<div class="mui-content-padded">
			<form class="mui-input-group" id="formID">
			<input type="hidden" name="openid" value="${openid}">
				<div class="mui-input-row">
					<label for="name">姓名</label>
					<input type="text" id="name" required="required" name="name" class="mui-input-clear" placeholder="请输入姓名">
				</div>
				<div class="mui-input-row">
					<label for="telphone">电话</label>
					<input type="tel" id="telphone"  required="required" name="telphone" class="mui-input-clear" placeholder="请输入电话">
				</div>
				<div class="mui-input-row">
					<label for="school">毕业学校</label>
					<input type="text" id="school" required="required"   name="school" class="mui-input-clear" placeholder="请输入毕业学校">
				</div>
				<p style="padding-left: 16px; font-size:18px; color: #000;
					padding-top: 10px;">选择专业:</p>
					<c:forEach var="major"  items="${ majors}">
						<div class="mui-input-row mui-radio mui-left">
								<label>${major.title }</label>
								<input name="major" type="radio" value="${major.aid }">
							</div>
					</c:forEach>
			</form>
			<div class="mui-input-row" style="width: 90％;">
				<p>备注</p>
				<textarea id="beizhu" rows="5" placeholder="请输入备注"></textarea>
			</div>
			<div class="mui-button-row">
				<button class="mui-btn mui-btn-primary" onclick="subForm()">确认</button>&nbsp;&nbsp;
				<button class="mui-btn mui-btn-primary" onclick="return false;">取消</button>
			</div>
		</div>

		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
		 function subForm(){
			 var arr  ={ "name" :"remark", "value" : $('#beizhu').val() };
			 console.info(arr);
			 var jsonArr=$("#formID").serializeArray();
				jsonArr.push(arr);
				 var d = {};
			 $.each(jsonArr, function() {
			       d[this.name] = this.value;
			     });
				$.post("/weixin/onLineRegister.do",d,function(data){
					if(data){
						 $("body").html('<p style="text-align: center;font-size: 22px;margin-top:30px;">恭喜您，一键报名成功!</p>');
					}else{
						 $("body").html('<p style="text-align: center;font-size: 22px;margin-top:30px;">很遗憾 ，报名失败!</p>');
					}
			 },"json") ; 
			 
		 }
		</script>
	</body>

</html>

